package com.example.rbac.dto;

import com.example.rbac.model.SysDept;
import com.google.common.collect.Lists;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import java.util.Comparator;
import java.util.List;

/**
 * @author XieLongzhen
 * @date 2018/12/29 23:59
 */
@Getter
@Setter
@ToString
public class DeptLevelDto extends SysDept {

    public static final Comparator<DeptLevelDto> COMPARATOR = Comparator.comparingInt(DeptLevelDto::getSeq);

    private List<DeptLevelDto> deptList = Lists.newArrayList();

    public static DeptLevelDto adapt(SysDept sysDept) {
        DeptLevelDto dto = new DeptLevelDto();
        BeanUtils.copyProperties(sysDept, dto);
        return dto;
    }
}
